<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>匹配URL</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
	span.red{
		color: red;
	}
    </style>
</head>
<body>
	<div class="container" id="container">
		<h1>匹配URL</h1>
		<div id="content">houdunren.com</div>
		<div>www.houdunren.com</div>
		<h1>houdunren.com</h1>
 		<h1>hdcms.com</h1>
	</div>
	<script type="text/javascript">

		 var urls = [
			 "https://www.houdunren.com",
			 'http://baidu.com',
			 'https://www.sina.com.cn',
			 'http://cloud.inwil.com',
			 'https://bms.admin.inwil.com',
		 ]
		 var reg = /https?:\/\/(\w+\.)*(\w+)(\.\w+)+/
		 urls.forEach(function(url) {
		 	console.log(reg.test(url))
		 })
	</script>
</body>
</html>